package client_updater

import javax.servlet.http.{ HttpServlet, HttpServletRequest, HttpServletResponse }
import db.Client
import java.io.PrintWriter
import java.io.ObjectOutputStream
import java.io.OutputStream
import javax.servlet.ServletOutputStream
import scala.actors.Actor
import executors.NewClientExecutor
import executors.NewClientExecutor


/**
 * extends HttpServlet, new clients connect to this servlet.
 */
class NewClientServlet extends HttpServlet{

  /**
   * overrides HttpServlet.doGet
   */
  override def doGet(req : HttpServletRequest, resp : HttpServletResponse){
    resp.setContentType("text/plain")
    val email = req.getParameter("email")
    val password = req.getParameter("password")    
    val result = NewClientExecutor.execute(email, password)
    resp.getWriter.println(result)
  }
}
